package com.study.hm;

import java.util.stream.Stream;

/**
 * @author study
 * @version 1.0
 * @date 2020/9/26 16:13
 */
public class StreamDemo {
    public static void main(String[] args) {
        Stream<String> stringStream = Stream.of("a", "e", "d", "ac", "b");

        //stringStream.forEach(System.out::println);
        Stream<String> filter = stringStream.filter(s -> s.startsWith("a"));
        System.out.println(filter);

        Stream<String> stream = Stream.of("1", "2", "3");
        Stream<Integer> integerStream = stream.map(s -> Integer.valueOf(s));
        integerStream.forEach(t -> System.out.println(t));


    }
}
